﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="FinancePercentageAuth.ascx.vb"
    Inherits="WebForm_ManageFinancePercentageFinance_FinancePercentageAuth" %>
<div style="background-color: #351D26">
    <fieldset id="plDivision" style="border-color: #4E333B" runat="server">
        <legend class="white2">
            <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:plOrg.GroupingText%>" />
        </legend>
        <table width="50%" cellpadding="0" cellspacing="0">
            <tr>
                <td align="left">
                    <ReportSearchOption:VersionControl ID="VersionControl1" runat="server" />
                </td>
            </tr>
            <tr>
                <td align="left">
                    <asp:Label ID="lblDivision" runat="server" meta:resourcekey="lblDivision"></asp:Label>
                    <asp:DropDownList ID="ddlDivision" runat="server" AutoPostBack="true">
                    </asp:DropDownList>
                    <asp:Label ID="lblSignature" runat="server" meta:resourcekey="lblSignature"></asp:Label>
                    <asp:DropDownList ID="ddlSignature" runat="server" />
                    <asp:Button ID="btnSearch" runat="server" meta:resourcekey="btnSearch" />
                </td>
            </tr>
        </table>
    </fieldset>
    <fieldset id="plList" visible="false" style="border-color: #4E333B" runat="server">
        <table width="100%" cellpadding="0" cellspacing="0"">
            <tr>
                <td width="95%" align="center">
                    <My:MyGridView ID="gv" runat="server" SkinID="pager" AllowPaging="False" meta:resourcekey="gv">
                        <Columns>
                            <asp:BoundField DataField="Division" meta:resourcekey="gvDivision" />
                            <asp:BoundField DataField="SignatureText" meta:resourcekey="gvSignature" />
                            <asp:TemplateField meta:resourcekey="gvItemName">
                                <itemtemplate>
                                    <asp:Label ID="lblItemName" SkinID="subSection runat="server" Text='<%# Bind("ItemName") %>' Font-Bold='<%# Bind("IsBold") %>'></asp:Label>
                                </itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="gvFix">
                                <itemtemplate>
                                    <asp:CheckBox ID="chkSelect" runat="server" Checked='<%# Bind("IsCheck") %>'  Visible='<%# Bind("IsEnable") %>'  />
                                </itemtemplate>
                                <itemstyle horizontalalign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="gvAuth">
                                <itemtemplate>
                                    <asp:CheckBox ID="chkSelectAuth" runat="server" Checked='<%# Bind("IsCheckAuth") %>'  Visible='<%# Bind("IsEnable") %>'  />
                                </itemtemplate>
                                <itemstyle horizontalalign="Center" />
                            </asp:TemplateField>
                        </Columns>
                    </My:MyGridView>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:Button ID="btnApply" runat="server" OnClientClick="return ApplyCheck()" meta:resourcekey="btnApply" />
                    <asp:Button ID="btnCancel" runat="server" meta:resourcekey="btnCancel" />
                    <asp:HiddenField ID="hideSaveToNext" runat="server" />
                    <asp:HiddenField ID="hideSpecialMonth" runat="server" />
                </td>
            </tr>
        </table>
    </fieldset>
</div>

<SCRIPT LANGUAGE="vbscript">   
  function   show(str)   
  show=msgbox(str,vbYesNo,"Confirm") 
  //是 6   
  //否 7   
  end   function   
</SCRIPT>   

<script type="text/javascript">
function ApplyCheck()
{
    var hideSaveToNext = document.getElementById("<%=hideSaveToNext.ClientID%>");
    var SpecialMonth = document.getElementById("<%=hideSpecialMonth.ClientID%>");

    if(SpecialMonth.value=="Y")
    {
        hideSaveToNext.value="N";
        return true;
    }
    else
    {
        var bln;
        bln=show("Would you apply the same setting to next monthly version?");
        switch(bln)   
        { 
            case   6:   
                hideSaveToNext.value="Y";
                break;   
            case   7:   
                hideSaveToNext.value="N";
                break;   
        }   
        return true;
    }
}
</script>
